#pragma once
#include <opencv2/opencv.hpp>
#include "buff_detect.h"
#define PI 3.1415927

using namespace cv;
using namespace std;

class get_omega
{
public:
	
	int frame_center_y = 0;
	int frame_center_x = 0;

	//根据方向预测能量机关的位置
	void energy_buff(int direction, int buff, int show_num, float angle,  float time1, struct logo final_center_R);

	//将相对位置转化为角度
	void forecast(Mat& image, float& yaw, float& pitch, struct logo final_center_R, int show_num);

	//绘制预测曲线
	void drawgraph(float point_x, float point_y, int show_num);
	
private:

	float delta_theta = 0;
	
	double focalLenth_ = 7.625;
	double inchPerPixWidth_ = (4.86 / 728.0);
	double inchPerPixHeight_ = (3.66 / 544.0);

	Mat graph_x, graph_y;
	vector<Point> point1;
	vector<Point> point2;
	Point2f point0;

	//得到预测位置
	Point forecast_point(int direction, float angle, float omega, struct logo R);
	
	//积分函数，根据时间以及速度公式得到Δθ
	float get_delta_x(float time);
};

